﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Heavy_Metals
{
    public partial class FXYXX_Dan : Form
    {
        public FXYXX_Dan()
        {
            InitializeComponent();
        }
        private void FXYXX_Dan_Load(object sender, EventArgs e)
        {
            DataGridViewLinkColumn lc = new DataGridViewLinkColumn();
            lc.HeaderText = "查看与分析";
            lc.Name = "查看与分析";
            lc.Width = 60;
            DataGridViewLinkColumn lc1 = new DataGridViewLinkColumn();
            lc1.HeaderText = "风险源查看与修改";
            lc1.Name = "风险源查看与修改";
            lc1.Width = 60;
            DataGridViewLinkColumn lc2 = new DataGridViewLinkColumn();
            lc2.HeaderText = "删除";
            lc2.Name = "删除";
            lc2.Width = 60;
            this.dataGridView1.Columns.Add("风险源名称", "风险源名称");
            this.dataGridView1.Columns.Add("经度坐标", "经度坐标");
            this.dataGridView1.Columns.Add("纬度坐标", "纬度坐标");
            this.dataGridView1.Columns.Add("所属企业", "所属企业");
            this.dataGridView1.Columns.Add(lc);
            this.dataGridView1.Columns.Add(lc1);
            this.dataGridView1.Columns.Add(lc2);
            this.dataGridView1.Rows.Add("风险源1", "23.4", "46.56", "大庆化工", "分析", "查看与修改", "删除");
            this.dataGridView1.Rows.Add("风险源2", "23.6", "22.5", "重庆利化工", "分析", "查看与修改", "删除");
        }
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != -1)
            {
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "查看与分析")
                {
                    FXYXX_Dan_FX fx = new FXYXX_Dan_FX();
                    fx.Show();
                }
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "风险源查看与修改")
                {
                    FXYXX_Dan_XXXG xg = new FXYXX_Dan_XXXG();
                    xg.Show();
                }
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "删除")
                {
                    this.dataGridView1.Rows.RemoveAt(e.RowIndex);
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = "";
            this.textBox2.Text = "";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.dataGridView1.Rows.Clear();
            this.dataGridView1.Rows.Add("风险源1", "23.4", "46.56", "大庆化工", "分析", "查看与修改", "删除");
        }


    }
}
